//
//  NewsTableViewCell.m
//  yonghu
//
//  Created by 浪尖渝力 on 2018/2/5.
//  Copyright © 2018年 com.DJS. All rights reserved.
//

#import "NewsTableViewCell.h"

@implementation NewsTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}
-(void)creatView{
    self.backgroundColor=_LightGrey;
    UIView *beiJingView=[UIView new];
    [self addSubview:beiJingView];
    [beiJingView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(20);
        make.right.mas_equalTo(-20);
        make.top.mas_equalTo(20);
        make.height.mas_equalTo(140);
    }];
    beiJingView.layer.cornerRadius=5;
    beiJingView.backgroundColor=[UIColor whiteColor];
    
    UIImageView *imageView=[UIImageView new];
    [beiJingView addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(20);
        make.width.height.mas_equalTo(30);
    }];
    imageView.image=[UIImage imageNamed:@"系统消息"];
    
    UIView *dianView=[UIView new];
    [imageView addSubview:dianView];
    [dianView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(0);
        make.top.mas_equalTo(0);
        make.width.height.mas_equalTo(10);
    }];
    dianView.layer.cornerRadius=5;
    dianView.backgroundColor=[UIColor redColor];
    
    NSNumber *mu_status=[_dic objectForKey:@"mu_status"];
    if (mu_status.intValue==1) {
        dianView.hidden=YES;
    };
    
    UILabel *label=[UILabel new];
    [beiJingView addSubview:label];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(imageView.mas_right).mas_equalTo(15);
        make.centerY.mas_equalTo(imageView);
    }];
    label.text=@"消息";
    label.textColor=ColorWithRGB(29, 29, 29);
    label.font=[UIFont systemFontOfSize:22];
    
    NSString *message_time_text=[_dic objectForKey:@"message_time_text"];
    UILabel *timeLable=[UILabel new];
    [beiJingView addSubview:timeLable];
    [timeLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.mas_equalTo(imageView);
    }];
    timeLable.text=message_time_text;
    timeLable.font=[UIFont systemFontOfSize:18];
    timeLable.textColor=ColorWithRGB(149, 149, 149);
    
    UIView *xianView=[UIView new];
    [beiJingView addSubview:xianView];
    [xianView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.mas_equalTo(0);
        make.top.mas_equalTo(imageView.mas_bottom).mas_equalTo(15);
        make.height.mas_equalTo(1);
    }];
    xianView.backgroundColor=_LightGrey;
    
    UILabel *label2=[UILabel new];
    [beiJingView addSubview:label2];
    [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(10);
        make.top.mas_equalTo(xianView.mas_bottom).mas_equalTo(15);
        make.right.mas_equalTo(-10);
    }];
    label2.text=[_dic objectForKey:@"message_content"];
    label2.textColor=ColorWithRGB(49, 49, 49);
    label2.font=[UIFont systemFontOfSize:18];
    label2.numberOfLines=2;

    
    
}

@end
